package com.drawquest.gui.panels;

import com.drawquest.data.Comment;
import com.gooddies.swing.swypepanel.SwitchablePanel;
import com.gooddies.wiring.annotations.WiringComponent;

@WiringComponent(singleton = true, lazy = true)
public class BigCommentsPanel extends SwitchablePanel {

    public BigCommentsPanel() {
        initComponents();
        setTitle("Comment");
        avatarImagePanel.setVerticalGap(2);
        avatarImagePanel.setHorizontalGap(2);
        imagePanel.setHorizontalGap(2);
        imagePanel.setVerticalGap(2);
    }

    public void setComment(Comment comment) {
        avatarImagePanel.setUrl(comment.getUser().getAvatarUrl());
        imagePanel.setUrl(comment.getQuest().getGallery());
        avatarLabel.setText(comment.getUser().getUserName());
        titleLabel.setText(comment.getQuest().getTitle());
        repaint();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        footerPanel = new com.drawquest.gui.components.FooterPanel();
        avatarLabel = new javax.swing.JLabel();
        avatarImagePanel = new com.drawquest.gui.components.ImagePanel();
        imagePanel = new com.drawquest.gui.components.ImagePanel();
        titleLabel = new javax.swing.JLabel();

        setBackground(new java.awt.Color(255, 255, 255));

        avatarLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        avatarLabel.setForeground(new java.awt.Color(51, 51, 255));
        avatarLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        avatarLabel.setText("jLabel1");

        avatarImagePanel.setBackground(new java.awt.Color(255, 255, 255));
        avatarImagePanel.setMinimumSize(new java.awt.Dimension(65, 65));
        avatarImagePanel.setPreferredSize(new java.awt.Dimension(65, 65));

        javax.swing.GroupLayout avatarImagePanelLayout = new javax.swing.GroupLayout(avatarImagePanel);
        avatarImagePanel.setLayout(avatarImagePanelLayout);
        avatarImagePanelLayout.setHorizontalGroup(
            avatarImagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 63, Short.MAX_VALUE)
        );
        avatarImagePanelLayout.setVerticalGroup(
            avatarImagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 63, Short.MAX_VALUE)
        );

        imagePanel.setBackground(new java.awt.Color(255, 255, 255));

        javax.swing.GroupLayout imagePanelLayout = new javax.swing.GroupLayout(imagePanel);
        imagePanel.setLayout(imagePanelLayout);
        imagePanelLayout.setHorizontalGroup(
            imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        imagePanelLayout.setVerticalGroup(
            imagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        titleLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        titleLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        titleLabel.setText("jLabel1");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(footerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(avatarImagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(avatarLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(titleLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE))
                    .addComponent(imagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(footerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 443, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(avatarImagePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(avatarLabel))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(titleLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGap(11, 11, 11)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(imagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private com.drawquest.gui.components.ImagePanel avatarImagePanel;
    private javax.swing.JLabel avatarLabel;
    private com.drawquest.gui.components.FooterPanel footerPanel;
    private com.drawquest.gui.components.ImagePanel imagePanel;
    private javax.swing.JLabel titleLabel;
    // End of variables declaration//GEN-END:variables
}
